//
//  BoottonTableViewCell.m
//  项目A --半糖
//
//  Created by romana on 16/5/28.
//  Copyright © 2016年 romana. All rights reserved.
//

#import "BoottonTableViewCell.h"

@implementation BoottonTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imgView];
        self.txtLable = [[UILabel alloc] init];
        [self.contentView addSubview:self.txtLable];
        self.txtLable.textColor = [UIColor whiteColor];
        self.txtLable.font = [UIFont systemFontOfSize:17];
        self.txtLable.numberOfLines = 0;
        self.imgViewZan = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"539922b87b110"]];
       // [self.imgView addSubview:self.imgViewZan];
        self.imgViewZan.backgroundColor = [UIColor lightGrayColor];
        self.imgViewZan.layer.cornerRadius = 5;
        self.imgView.userInteractionEnabled = YES;
     //   self.imgViewZan.userInteractionEnabled = YES;
        self.imgViewZan.layer.masksToBounds = YES;
     //   self.btn = [UIButton buttonWithType:UIButtonTypeCustom];
    //    [self.btn setImage:[UIImage imageNamed:@"iconfont-zhiboqiapiandianzan"] forState:(UIControlStateNormal)];
   //     [self.btn setImage:[UIImage imageNamed:@"iconfont-dianzan"] forState:(UIControlStateSelected)];
   //     [self.imgViewZan addSubview:self.btn];
  //      [self.btn addTarget:self action:@selector(click:) forControlEvents:(UIControlEventTouchUpInside)];
        self.lableNumber = [[UILabel alloc] init];
        [self.imgViewZan addSubview:self.lableNumber];
        self.lableNumber.font = [UIFont systemFontOfSize:10];
        self.lableNumber.textAlignment = NSTextAlignmentCenter;
        self.lableNumber.textColor = [UIColor whiteColor];
        //        self.lableNumber.backgroundColor = [UIColor yellowColor];
        //        self.btn.backgroundColor = [UIColor yellowColor];
        //        self.txtLable.backgroundColor = [UIColor redColor];
        //        self.imgView.backgroundColor = [UIColor yellowColor];
    }
    return self;
}


-(void)layoutSubviews{
    [super layoutSubviews];
    self.imgView.frame = CGRectMake(5, 5, self.contentView.frame.size.width - 10, self.contentView.frame.size.height - 10);
    self.txtLable.frame = CGRectMake(20, self.imgView.frame.size.height / 1.3, self.imgView.frame.size.width - 50, 50);
  //  self.imgViewZan.frame = CGRectMake(self.contentView.frame.size.width - 50, 0, 35, 43);
    self.btn.frame = CGRectMake(5, 5, self.imgViewZan.frame.size.width - 10, self.imgViewZan.frame.size.height - 20);
    self.lableNumber.frame = CGRectMake(0, self.imgViewZan.frame.size.height - 17, self.imgViewZan.frame.size.width, 13);
    
 //   self.btn.selected = [[DataBaseManager shareIndtance] selectLikeByTitle:self.txtLable.text];
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
